home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
other
/
ioblixdevkit
/
autodocs
/
ioblixser.doc
< prev
Wrap
Text File
|
1999-05-14
|
23KB
|
594 lines
TABLE OF CONTENTS
ioblixser.device/AbortIO
ioblixser.device/BeginIO
ioblixser.device/CloseDevice
ioblixser.device/CMD_CLEAR
ioblixser.device/CMD_FLUSH
ioblixser.device/CMD_READ
ioblixser.device/CMD_RESET
ioblixser.device/CMD_START
ioblixser.device/CMD_STOP
ioblixser.device/CMD_WRITE
ioblixser.device/GetChipInfo
ioblixser.device/OpenDevice
ioblixser.device/SDCMD_BREAK
ioblixser.device/SDCMD_QUERY
ioblixser.device/SDCMD_SETPARAMS
ioblixser.device/SIOCMD_SETCTRLLINES
ioblixser.device/AbortIO ioblixser.device/AbortIO
NAME
AbortIO(ioRequest) -- abort an I/O request
A1
FUNCTION
This is an exec.library call.
This function attempts to aborts a specified read or write request.
If the request is active, it is stopped immediately. If the request is
queued, it is painlessly removed. The request will be returned
in the same way any completed request it.
After AbortIO(), you must generally do a WaitIO().
INPUTS
IORequest -- pointer to the IORequest Block that is to be aborted.
RESULTS
io_Error -- if the Abort succeded, then io_Error will be #IOERR_ABORTED
(-2) and the request will be flagged as aborted (bit 5 of
io_Flags is set). If the Abort failed, then the Error will be zero.
ioblixser.device/BeginIO ioblixser.device/BeginIO
NAME
BeginIO(ioRequest),deviceNode -- start up an I/O process
A1 A6
FUNCTION
This is a direct function call to the device. It is intended for
more advanced programmers. See exec's DoIO() and SendIO() for
the normal method of calling devices.
This function initiates a I/O request made to the serial
device. Other than read or write, the functions are performed
synchronously, and do not depend on any interrupt handling
logic (or it's associated discontinuities), and hence should
be performed as IO_QUICK.
With some exceptions, reads and writes are merely initiated by
BeginIO, and thusly return to the caller as begun, not completed.
Completion is signalled via the standard ReplyMsg routine.
Multiple requests are handled via FIFO queueing.
One exception to this non-QUICK handling of reads and writes
is for READS when:
- IO_QUICK bit is set
- There are no pending read requests
- There is already enough data in the input buffer to satisfy
this I/O Request immediately.
In this case, the IO_QUICK flag is not cleared, and the request
is completed by the time it returns to the caller. There is no
ReplyMsg or signal bit activity in this case.
INPUTS
ioRequest -- pointer to an I/O Request Block of size
io_ExtSerSize (see serial.i for size/definition),
containing a valid command in io_Command to process,
as well as the command's other required parameters.
deviceNode -- pointer to the "ioblixser.device", as found in
the IO_DEVICE of the ioRequest.
RESULTS
io_Error -- if the BeginIO succeded, then Error will be null.
If the BeginIO failed, then the Error will be non-zero.
I/O errors won't be reported until the io completes.
SEE ALSO
devices/serial.h
ioblixser.device/CloseDevice ioblixser.device/CloseDevice
NAME
CloseDevice -- close the serial port
SYNOPSIS
CloseDevice(deviceNode)
A1
FUNCTION
This is an exec call that terminates communication with the
serial device. Upon closing, the device's input buffer is freed.
Note that all IORequests MUST be complete before closing.
If any are pending, your program must AbortIO() then WaitIO()
to complete them.
INPUTS
deviceNode - pointer to the device node, set by Open
SEE ALSO
ioblixser.device/OpenDevice
ioblixser.device/CMD_CLEAR ioblixser.device/CMD_CLEAR
NAME
Clear -- clear the serial port buffers
FUNCTION
This command resets the serial port's read buffer pointers.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_CLEAR
RESULTS
Error -- If the Clear succeded, then io_Error will be null.
If the Clear failed, then the io_Error will be non-zero.
ioblixser.device/CMD_FLUSH ioblixser.device/CMD_FLUSH
NAME
Flush -- clear all queued I/O requests for the serial port
FUNCTION
This command purges the read and write request queues for the
serial device. Flush will not affect active requests.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_FLUSH
RESULTS
Error -- if the Flush succeded, then io_Error will be null.
If the Flush failed, then the io_Error will be non-zero.
ioblixser.device/CMD_READ ioblixser.device/CMD_READ
NAME
Read -- read input from serial port
FUNCTION
This command causes a stream of characters to be read in from
the serial port buffer. The number of characters is specified
in io_Length.
The Query function can be used to check how many characters
are currently waiting in the serial port buffer. If more characters
are requested than are currently available, the ioRequest
will be queued until it can be satisfied.
The best way to handle reads is to first Query to get the number
of characters currently in the buffer. Then post a read request
for that number of characters (or the maximum size of your buffer).
If zero characters are in the buffer, post a request
for 1 character. When at least one is ready, the device will return
it. Now start over with another Query.
Before the program exits, it must be sure to AbortIO() then WaitIO()
any outstanding ioRequests.
IO REQUEST
io_Message A mn_ReplyPort is required
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_READ
io_Flags If the IOB_QUICK bit is set, read will try
to complete the IO quickly
io_Length number of characters to receive.
io_Data pointer to buffer
RESULTS
Error -- if the Read succeded, then io_Error will be null.
If the Read failed, then io_Error will be non-zero.
io_Error will indicate problems such as parity mismatch,
break, and buffer overrun.
SEE ALSO
ioblixser.device/SDCMD_QUERY
ioblixser.device/SDCMD_SETPARAMS
BUGS
Having multiple outstanding read IORequests at any one time will
probably fail.
Old documentation mentioned a mode where io_Length was set to -1.
If you want a NULL terminated read, use the io_TermArray instead.
ioblixser.device/CMD_RESET ioblixser.device/CMD_RESET
NAME
Reset -- reinitializes the serial port
FUNCTION
This command resets the serial port to its freshly initialized
condition. It aborts all I/O requests both queued and current,
relinquishes the current buffer, obtains a new default sized
buffer, and sets the port's flags and parameters to their
boot-up time default values. The functions places the reset
parameter values in the ioRequest block.
IO REQUEST
io_Message mn_ReplyPort initialized
io_Device set by OpenDevice
io_Unit set by OpenDevice
io_Command CMD_RESET
RESULTS
Error -- if the Reset succeded, then Error will be null.
If the Reset failed, then the Error will be non-zero.
ioblixser.device/CMD_START